package cn.icyzx.util;

import org.jboss.logging.Logger;

import java.io.IOException;
import java.util.Properties;

/**
 * Created by zk on 2016/9/28.
 */
public class GetServerUtil {

    private static Properties properties = new Properties();

    private static Logger logger = Logger.getLogger(GetServerUtil.class);

    static {
        try {
            properties.load(GetServerUtil.class.getClassLoader().getResourceAsStream("server.properties"));
        } catch (IOException e) {
            logger.error("读取不到server.properties");
            e.printStackTrace();
        }
    }

    public static String getServerName() {
        return properties.getProperty("server");
    }

    public static String getJdbcUrl() {
        return properties.getProperty("jdbc.url");
    }

    public static String getJdbcUsername() {
        return properties.getProperty("jdbc.username");
    }

    public static String getJdbcPassword() {
        return properties.getProperty("jdbc.password");
    }

    public static String getJdbcDriver() {
        return properties.getProperty("jdbc.driver");
    }

}
